﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DispatchAssist.Model;
using DispatchAssist.BusinessLogical.DAL;

namespace DispatchAssist.BusinessLogical.BLL
{
   public class ActionLogManager
    {
       static log4net.ILog Logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);

       private static IDataProvider _provider = new SqlDataProvider();

       public static void WriteActionLog(List<ActionPerformLog> logList)
       {
           try
           {
               _provider.WriteActionLog(logList);
           }
           catch (Exception e)
           {
               Logger.Error(e);
           }
       }

       public static void WriteActionLog(Guid AlertID, int Action, DateTime PerformTime, Guid UserID, string Des)
       {
           List<ActionPerformLog> list = new List<ActionPerformLog>();

           ActionPerformLog log = new ActionPerformLog();

           log.AlertID = AlertID;
           log.UserID = UserID;
           log.PerformTime = PerformTime;
           log.AlertAction = Action;
           log.Description = Des;

           list.Add(log);

           WriteActionLog(list);
       }
    }
}
